home *** CD-ROM | disk | FTP | other *** search
- Path: keats.ugrad.cs.ubc.ca!not-for-mail
- From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
- Newsgroups: comp.lang.c
- Subject: Re: HELP IN WRITING MY FIRST PROGRAM ASSINGMENT
- Date: 26 Feb 1996 13:48:54 -0800
- Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
- Message-ID: <4gt9s6INN8c4@keats.ugrad.cs.ubc.ca>
- References: <3127dd4f.19010083@news.planet.net> <4gikk6INNjiv@keats.ugrad.cs.ubc.ca>
- NNTP-Posting-Host: keats.ugrad.cs.ubc.ca
-
- In article <4gikk6INNjiv@keats.ugrad.cs.ubc.ca>,
- I goofed up a little, here is the correction:
-
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- int c(char **x,char**y){return strcmp(*x,*y);}int main(){int i=0,j;char
- x[256],*y[100];for(i=0;i<100&&fgets(x,256,stdin);i++)
- i[y]=strdup(x);qsort(y,i,sizeof(char*),(int(*)(const void*,const
- void*))c); for(j=0;j<i;j++)fputs(j[y],stdout);return 0;}
- --
-
-